/* eslint-disable */
// 用户头像--->
import u10 from '@/assets/userImg/10.png';
import u11 from '@/assets/userImg/11.png';
import u12 from '@/assets/userImg/12.png';
import u13 from '@/assets/userImg/13.png';
import u14 from '@/assets/userImg/14.png';
import u15 from '@/assets/userImg/15.png';
import u16 from '@/assets/userImg/16.png';
import u17 from '@/assets/userImg/17.png';
// <---用户头像

// vip等级--->
import v1 from '@/assets/imgVip/v01.png';
import v2 from '@/assets/imgVip/v02.png';
import v3 from '@/assets/imgVip/v03.png';
// <---vip等级

const MMEvent = {
    install: function(Vue) {
        Vue.prototype.$MMEV = this;
        this.$Vue = Vue;
    },
    /**
     * @desc 去掉前后空格
     * @str  字符data
     */
    TrimFS(str) {
        return str.replace(/(^\s*)|(\s*$)/g, '');
    },
    /**
     * @desc 返回用户头像
     * @data 用户头像id
     */
    userImgFS(data) {
        let userImg = u10;
        switch (data) {
            case 11:
                userImg = u11;
                break;
            case 12:
                userImg = u12;
                break;
            case 13:
                userImg = u13;
                break;
            case 14:
                userImg = u14;
                break;
            case 15:
                userImg = u15;
                break;
            case 16:
                userImg = u16;
                break;
            case 17:
                userImg = u17;
                break;
        }
        return userImg;
    },
    /**
     * @desc 用户头像列表
     */
    userImgListData: [
        { url: u10, data: 10 },
        { url: u11, data: 11 },
        { url: u12, data: 12 },
        { url: u13, data: 13 },
        { url: u14, data: 14 },
        { url: u15, data: 15 },
        { url: u16, data: 16 },
        { url: u17, data: 17 },
    ],
    /**
     * @desc 返回用户头像
     * @data 用户头像id
     */
    userVipFS(data) {
        let userVip = v1;
        switch (data) {
            case 2:
                userVip = v2;
                break;
            case 3:
                userVip = v3;
                break;
        }
        return userVip;
    },
    /**
     * @desc 用户头像列表
     */
    userVipListData: [
        { url: v1, data: 1 },
        { url: v2, data: 2 },
        { url: v3, data: 3 },
    ],
    /**
     * @desc 全局消息提示二次封装element：message
     */
    messageFS(data) {
        let customClass = 'MMmessage';
        switch (true) {
            case data.type == 'error':
                customClass = 'MMError';
                break;
            case data.type == 'warning':
                customClass = 'MMWarning';
                break;
            case data.type == 'success':
                customClass = 'MMSuccess';
                break;
        }
        data.customClass = customClass;
        this.$Vue.prototype.$message(data);
    },
};

export default MMEvent;
